#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <windows.h>
//hi~~
int main(){

    int i,j;
    int len;
    int index;
    int cnt;
    char *value;
    char buf[100];
    //test2
    FILE *fh = fopen("test.txt","w");
    
    char a[10000] = "+1 1:0.071429 2:-0.511628 3:-0.876289 4:-0.567010 5:-0.278351 6:-0.938144 7:-0.525773 8:0.281553 9:-0.902913 10:-0.902913 11:-1.000000 12:-0.980583 13:-0.592233 14:-0.941748 15:-0.281553 16:-0.003344 17:-0.812709 18:-0.973244 19:-0.973244 20:-1.000000 21:-0.973244 22:-1.000000 23:-0.946488 24:-0.979933 25:-0.859532 26:-0.953177 27:-0.973244 28:-1.000000 29:-0.605351 30:-0.979933 \n";
    char b[10000] = "+1 1:-0.665673 2:0.074245 3:0.715307 4:0.681720 5:-0.326051 6:0.071986 7:0.317180 8:-0.120724 9:0.429078 10:-0.208528 11:0.063513 12:-0.139655 13:0.203728 14:0.380625 15:0.300021 16:-0.138884 17:0.336433 18:-0.315619 19:-0.250476 20:-0.035511 21:-0.186517 22:-0.525083 23:0.528734 24:-0.380046 25:0.039663 26:-0.097766 27:0.413524 28:0.013493 29:-0.387527 30:0.591578";    
    
    char c[10000];
    char *buf2;
    char fin[100];
    
    strcpy(c,a);
    
    strtok(c,":");
    strtok(NULL," ");
    while(1){        
        buf2 = strtok(NULL,":");
        if(strtok(NULL , " ")== NULL)
            break;
        strcpy(fin , buf2);
        
    //    printf("%d",atoi(fin));
    //    getchar();

    }
    printf("%d",atoi(fin));
    getchar();
    
    len = strlen(a);
    
    a[len-1] = 0;
    
    
    strtok(b,":");
    cnt = 1;    
    while(1){
        if(cnt!=1)
            if(strtok(NULL,":") == NULL)
                break;
        value = strtok(NULL," ");
        sprintf(buf," %d:%s",atoi(fin)+cnt,value);
      //  printf("%s",buf);
       // getchar();
        strcat(a,buf);
        cnt++;
    }
    strcat(a,"\n");
        
        

    fprintf(fh ,"%s",a);

    

}
